package top.bulk.idgeneration.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.bulk.idgeneration.genertation.RedisIdGen;
import top.bulk.idgeneration.genertation.SegmentIdGen;
import top.bulk.idgeneration.genertation.SnowflakeIdGen;

/**
 * 配置类 - 自定义的生成器- 默认不满足情况下，可以自定义
 *
 * @author 散装java
 * @date 2024-08-13
 */
@Configuration
public class IdGenConfig {
    @Bean
    public SegmentIdGen SegmentIdGen1022() {
        return new SegmentIdGen(102, 2);
    }

    @Bean
    public SnowflakeIdGen snowflakeIdGen22() {
        return new SnowflakeIdGen(2, 2);
    }

    @Bean
    public RedisIdGen redisIdGen1022() {
        return new RedisIdGen(102, 2L);
    }
}
